# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Maintainer: Daniel Maslowski <info@orangecms.org>

pkgbase=pycosat
pkgname=(python-pycosat)
pkgver=0.6.6
pkgrel=1
arch=(loong64 x86_64)
url='https://github.com/conda/pycosat'
pkgdesc='Python bindings to picosat (a SAT solver)'
license=(MIT)
depends=(glibc
         python)
makedepends=(python-build
             python-installer
             python-setuptools
             python-wheel)
source=(https://github.com/conda/$pkgbase/archive/$pkgver/$pkgbase-$pkgver.tar.gz)
sha256sums=('b0014986321e77a36d8fe24827698aae076500c817133a700608bd677b77a998')

build() {
  cd $pkgbase-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $pkgbase-$pkgver
  PYTHONPATH="$PWD"/$(ls -d build/lib*) \
  python test_pycosat.py
}

package_python-pycosat() {
  cd $pkgbase-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
